import anime from 'animejs'

export function getRandomColor() {
  const letters = '0123456789ABCDEF'
  let color = '#'

  for (let i = 0; i < 6; i++) {
    color += letters[Math.floor(Math.random() * 16)]
  }

  return color
}


export function animeThen(config) {
  return new Promise(resolve => {
    let oldComplete = config.complete
    config.complete = () => {
      oldComplete && oldComplete()
      resolve()
    }
    anime(config)
  })
}